In [2]:
import trimesh
def load_mesh_scene(filename, show_edges=False):
mesh = trimesh.load(filename)
color = [128, 176, 255, 255]
mesh.visual.face_colors = color
geometries = [mesh]
if show_edges:
edges = mesh.face_adjacency_edges
path = trimesh.path.Path3D(**trimesh.path.exchange.misc.edges_to_path(edges, mesh.vertices.copy()))
geometries.append(path)
scene = trimesh.Scene(geometries)
return scene, mesh
In [35]:
#scene, mesh = load_mesh_scene("Obsidian-hmm-10.stl")
scene, mesh = load_mesh_scene("mesh(10).stl")
In [31]:
len(mesh.vertices)
Out[31]:
In [36]:
scene.show()
Out[36]: